<!-- eslint-disable vue/multi-word-component-names -->
<!-- eslint-disable vue/no-mutating-props -->
<template>
    <vue-latex :expression="'\\dfrac{\\omega^{2}}{s^{2}+2\\xi\\omega s+\\omega^{2}}'" display-mode />
    <labelArea label="参数">
        <el-form size="small" label-suffix=" :">
            <el-form-item label="参数模式">
                <el-select v-model="data.ParameterMode">
                    <el-option label="阻尼比-角速度" value="Ksi-Omega" />
                    <el-option label="A-B" value="A-B" />
                </el-select>
            </el-form-item>
            <el-form-item label="阻尼比">
                <el-input v-model="data.ksi" placeholder=""></el-input>
            </el-form-item>
            <el-form-item label="角速度">
                <el-input v-model="data.omega" placeholder=""></el-input>
            </el-form-item>
            <el-form-item v-if="data.ParameterMode == 'A-B'" label="a">
                <el-input v-model="data.a" placeholder=""></el-input>
            </el-form-item>
            <el-form-item v-if="data.ParameterMode == 'A-B'" label="b">
                <el-input v-model="data.b" placeholder=""></el-input>
            </el-form-item>
            <el-form-item label="初始参数">
                <el-input v-model="data.InitialCondition" placeholder=""></el-input>
            </el-form-item>
            <el-form-item label="仿真步长">
                <el-input v-model="data.TimeStep" placeholder=""></el-input>
            </el-form-item>
        </el-form>
    </labelArea>
</template>

<script setup>
const { data, config } = defineProps(['data', 'config'])


const gongshi = {
    arr1: ['PID', 'PI', 'PD', 'P', 'I',],
    arr2: ['理想', '并行'],
    kus: [
        [
            'P\\left(1+I\\dfrac{1}{s}+D\\dfrac{N}{1+N\\dfrac{1}{s}}\\right)',
            'P\\left(1+I\\dfrac{1}{s}\\right)',
            'P\\left(1+D\\dfrac{N}{1+N\\dfrac{1}{s}}\\right)',
            'P',
            'I\\dfrac{1}{s}'
        ],
        [
            'P+I\\dfrac{1}{s}+D\\dfrac{N}{1+N\\dfrac{1}{s}}',
            'P+I\\dfrac{1}{s}',
            'P+D\\dfrac{N}{1+N\\dfrac{1}{s}}',
            'P',
            'I\\dfrac{1}{s}'
        ]
    ]
}

function getLatex() {
    return gongshi.kus[config.form][config.controller]
}
</script>


<style scoped></style>